package com.lmb.controller;

import com.lmb.bean.RatioData;
import com.lmb.bean.StatisticsCount;
import com.lmb.service.StatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * 统计数据控制器
 */
@RestController
@RequestMapping("/statistics")
public class StatisticController {

    @Autowired
    private StatisticService statisticService;

    /**
     * 获取居民性别比例
     */
    @GetMapping("/gender-ratio")
    public List<RatioData> getGenderRatio() {
        return statisticService.getGenderRatio();
    }

    /**
     * 获取紧急事务类型比例
     */
    @GetMapping("/emergency-type-ratio")
    public List<RatioData> getEmergencyTypeRatio() {
        return statisticService.getEmergencyTypeRatio();
    }

    /**
     * 获取各类统计数量
     */
    @GetMapping("/basic-counts")
    public StatisticsCount getBasicCounts() {
        return statisticService.getBasicCounts();
    }
}
